<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <title>基础数据配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" th:href="@{/static/layui/css/layui.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/thesame.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/rightCon.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/footer.css}" />
    <style>
        .add-mess-par .add-mess-child{ margin-bottom: 20px; }
        .add-mess-par .add-mess-child > div:nth-child(1){ width: 130px; }
        .add-mess-par .add-mess-child input{ width: 100%; }
        .add-mess-par .add-mess-child p{ position: relative; }
        .add-mess-par .add-mess-child p::after{
            content: '%';
            font-size: 14px;
            display: block;
            position: absolute;
            right: 10px;
            top: 0;
            color: #333;
        }
        .layui-table-par tr:last-child td{ border: 0; }
        .layui-table-par input{ width: 160px; margin: 0 auto; border: 1px solid rgba(17, 15, 61, 0.1); border-radius: 4px; height: 30px; line-height: 30px; }
    </style>
</head>

<body class="layui-layout-body">
<div class="layui-body">
    <form id="basicDataForm">
        <div class="scroll-box new-add-box-width bgWhite box-shadows border-radius4">
            <div class="new-add-box-scroll">
                <div class="add-mess add-mess-par mar25px">
                    <article class="overflow">
                        <div class="add-mess-child">
                            <div>
                                <label>户籍老人床位比例：</label>
                            </div>
                            <input name="id"  type="hidden" th:value="${basicData?.id}"/>
                            <div class="add-mess-form">
                                <p><input name="hd" th:value="${basicData?.hd}" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" type="text" placeholder="请输入"></p>
                            </div>
                            <div class="green">（保基本床位/户籍老人）</div>
                        </div>
                        <div class="add-mess-child">
                            <div>
                                <label>户籍老人护理床位比例：</label>
                            </div>
                            <div class="add-mess-form">
                                <p><input name="hl" th:value="${basicData?.hl}" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" type="text"  placeholder="请输入"></p>
                            </div>
                            <div class="green">（护理/保基本床位）</div>
                        </div>
                    </article>
                </div>
                <div class="border1px border-radius4" style="width: 680px; margin:0 25px">
                    <table class="layui-table layui-table-header layui-table-par">
                        <thead>
                        <tr>
                            <th>养老机构名称</th>
                            <th>核定床位数</th>
                            <th>护理床位数</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>安亭福利院</td>
                            <td><input type="text" name="atflyHd" th:value="${basicData?.atflyHd}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                            <td><input type="text" name="atflyHl" th:value="${basicData?.atflyHl}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                        </tr>
                        <tr>
                            <td>黄渡社区福利院</td>
                            <td><input type="text" name="hdsqflyHd" th:value="${basicData?.hdsqflyHd}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                            <td><input type="text" name="hdsqflyHl" th:value="${basicData?.hdsqflyHl}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                        </tr>
                        <tr>
                            <td>方泰敬老院</td>
                            <td><input type="text" name="ftjlyHd" th:value="${basicData?.ftjlyHd}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                            <td><input type="text" name="ftjlyHl" th:value="${basicData?.ftjlyHl}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                        </tr>
                        <tr>
                            <td>联西敬老院</td>
                            <td><input type="text" name="lxjlyHd" th:value="${basicData?.lxjlyHd}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                            <td><input type="text" name="lxjlyHl" th:value="${basicData?.lxjlyHl}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                        </tr>
                        <tr>
                            <td>赵巷村长者照护</td>
                            <td><input type="text" name="zxczzzhHd" th:value="${basicData?.zxczzzhHd}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                            <td><input type="text" name="zxczzzhHl" th:value="${basicData?.zxczzzhHl}" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入" class="layui-input"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="layui-footer layui-footer-one">
    <div class="btn-con textCenter">
        <span onclick="saveBasicDataInfo()" class="btn-two cursor">提&nbsp;交</span>
    </div>
</div>
<script th:src="@{/static/js/jquery-2.1.3.min.js}"></script>
<script th:src="@{/static/js/basePath.js}"></script>
<script th:src="@{/static/layui/layui.js}"></script>
<script>
    layui.use(['element','form'], function() {
        var element = layui.element;
        var form = layui.form;
    });
    function saveBasicDataInfo() {
        var basicDataForm =new FormData(document.getElementById("basicDataForm"));
        $.ajax({
            url:getRootPath_web()+'statistics/saveBasicStaticDataSet',
            type:'post',
            dataType:'json',
            data:basicDataForm,
            processData: false,
            contentType: false,
            success:function (result) {
                if(result.code=='0000'){
                    layui.use('layer', function() {
                        var layer = layui.layer;
                        layer.confirm(result.codeDesc, {
                            btn: ['确定'] //按钮
                            ,shadeClose: false
                            ,closeBtn:false
                        }, function(){
                            layer.close(layer.index);
                        })
                    })
                }else {
                    layui.use('layer', function() {
                        var layer = layui.layer;
                        layer.confirm(result.codeDesc, {
                            btn: ['确定'] //按钮
                            ,shadeClose: false
                            ,closeBtn:false
                        }, function(){
                            layer.close(layer.index);
                        })
                    })
                }
            }
        })
    }
</script>
</body>

</html>
